package com.zxcl.feign;

import com.zxcl.domain.Basket;
import com.zxcl.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(value = "cart-service")
public interface OrderCartFeign {

    /**
     * 根据购物车ID查询购物车信息
     *
     * @param basketIds
     * @return
     */
    @GetMapping("p/shopCart/getBasketsByIds")
    Result<List<Basket>> getBasketsByIds(@RequestParam("basketIds") List<Long> basketIds);

    /**
     * 根据会员openId和skuIds清空购物车
     */
    @PostMapping("p/shopCart/clearCart")  // 传对象所以用的是请求体
    Result<Boolean> clearCart(@RequestBody List<Long> skuIds, @RequestParam("openId") String openId);

}
